@extends('admin.layout.common')
@section('content')
	<link rel="stylesheet" type="text/css" href="{{URL::asset('/js/layui-v2.3.0/layui/css/layui.css')}}">
	<link rel="stylesheet" type="text/css" href="{{URL::asset('css/professionalWork/AuthorizedCompanyManagement.css')}}">
			<div class="content">
				<input type="button" value="添加授权" class="add_authorization add">
				<table border="1" width="90%" id="myTable">
					<tr>
						<th>ID</th>
						<th>公司名称</th>
						<th>联系人</th>
						<th>联系方式</th>
						<th>社会统一编码</th>
						<th>营业执照</th>
						<th>地址</th>
						<th>操作</th>
					</tr>
					@foreach($list as $v)
					<tr>
						<td>{{$v->id}}</td>
						<td>{{$v->company_name}}</td>
						<td>{{$v->phone_name}}</td>
						<td>{{$v->phone}}</td>
						<td>{{$v->code}}</td>
						<td style="cursor:pointer;margin:0 auto;" onclick="viewPic('{{$v->company_image}}')">查看</td>
						<td>{{$v->address}}</td>
						<td><input type="button" name="" value="删除" class="layui-btn layui-btn-radius layui-btn-danger" onclick="deleteBusiness({{$v->id}})"></td>
					</tr>
					@endforeach
				</table>
				{{ $list->links()}}
			</div>

{{--<script type="text/javascript" src="{{URL::asset('common/js/jquery-1.10.1.min.js')}}"></script>--}}
<script type="text/javascript" src="{{URL::asset('/js/layui-v2.3.0/layui/layui.all.js')}}"></script>
<script type="text/javascript" src="{{URL::asset('js/professionalWork/AuthorizedCompanyManagement.js')}}"></script>
<script>
    $(function(){
        // 添加授权弹窗
        $(".add_authorization").on("click",function(){
            layer.open({
                type:2,
                shadeClose: true, //点击遮罩关闭
                skin: 'layui-layer-rim', //加上边框
                area: ['700px', '690px'], //宽高
                content: 'http://{{$_SERVER['HTTP_HOST']}}/admin/addBusiness'
                ,end: function () {
                    location.reload();
                }
            });
        });
    });
    // 查看弹窗
    function viewPic(url) {
        layer.open({
            type:2,
            area:['600px','670px'],
			btn:["确定","取消"],
            content:url
        })
    }

</script>
@endsection

